Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve f64 to i32 conversion for Math.imul and Math.clz32 #779

Merged
merged 4 commits into from
Aug 23, 2019
Merged

Improve f64 to i32 conversion for Math.imul and Math.clz32 #779

merged 4 commits into from
Aug 23, 2019

Conversation

MaxGraey
Copy link
Member

No description provided.

@MaxGraey MaxGraey requested a review from dcodeIO August 20, 2019 20:24
const inv32 = 1.0 / 4294967296;
return <i32><i64>(x - 4294967296 * floor(x * inv32));
} else {
let result = 0;
Copy link
Member Author

@MaxGraey MaxGraey Aug 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path on 10% faster previous one but gen much bigger code so I separate it by ASC_SHRINK_LEVEL

Copy link
Member

@dcodeIO dcodeIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dcodeIO dcodeIO merged commit 12aed07 into AssemblyScript:master Aug 23, 2019
@MaxGraey MaxGraey deleted the improve-f64-to-i32-special-conv branch August 23, 2019 12:51
willemneal pushed a commit to nearprotocol/assemblyscript that referenced this pull request Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants